<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/main.css">

</head>

<body>
    <div class="menus">
        <span id="btn">打开/关闭</span>
        <ul id="menusList" style="display: none;">
            <li>添加</li>
            <li>删除</li>
            <li>修改</li>
        </ul>
    </div>
    <script>
        const btn = document.getElementById('btn');
        const menusList = document.getElementById('menusList');
        btn.onclick = function () {
            if (menusList.style.display === 'none') {
                menusList.style.display = 'block';
            } else {
                menusList.style.display = 'none';
            }
        }

    </script>
</body>

</html>